<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="/js/jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="/js/jquery-ui-1.8.21.custom.min.js"></script>
<script type="text/javascript" src="/js/jquery.leanModal.min.js"></script>
<link type="text/css" href="/css/start/jquery-ui-1.8.21.custom.css" rel="Stylesheet" />
<script type="text/javascript">
function transfer(date_begin,date_end){
	window.location.href = 'http://<?php echo WEB_IP?>/staff/team-bonus-wizard-new-cal-bonus/date_begin/'+ date_begin + '/date_end/' + date_end + '/next/yes';
}

function transfer2(date_begin,date_end){
	window.location.href = 'http://<?php echo WEB_IP?>/staff/team-bonus-wizard-cal-bonus/date_begin/'+ date_begin + '/date_end/' + date_end + '/next/yes';
}
</script>

<style type="text/css">
/* <![CDATA[ */

table, td
{
    border-color: #666;
    border-style: solid;
}
table, th
{
    border-color: #666;
    border-style: solid;
}

table
{
    border-width: 0 0 1px 1px;
    border-spacing: 0;
    border-collapse: collapse;
}

td
{
    margin: 0;
    padding: 1px;
    border-width: 1px 1px 0 0;
}
th
{
    margin: 0;
    padding: 1px;
    border-width: 1px 1px 0 0;
}

/* ]]> */
</style>

</head>

<body style="font-family:Arial, Helvetica, sans-serif">
<h1>INPUT Shop Weekly Target ( <?php echo $this->cycle;?> )</h1>
<h3>Calculate Bonus, Just Click Next</h3>
<form method="post" action = "" enctype="multipart/form-data">
<input type = "file" name = "upload_file" id = "upload_file" ></input>
<input type = "submit" name = "upload" id = "upload" value = "Upload File"></input><br/><br/>
<?php if($this->targetList){?>
<table width = "800" cellspacing="1" cellpadding="3">

  <tr>
    <th scope="col">Shop</th>
    <th scope="col">Date Begin</th>
    <th scope="col">Date End</th>
    <th scope="col">Target</th>
    <th scope="col">Target2</th>
    <th scope="col">Target3</th>
    <th scope="col">HTarget</th>
    <th scope="col">HTarget2</th>
    <th scope="col">HTarget3</th>
  </tr>
<?php
//$shopArr = array("ADPC","BBPC","BHPC","BSIC","BSPC","BSXP","CBPC","CLIC","CLPC","DCIC","EPIC","EPPC","FGIC","HPIC","KCPC","NLPC","PMIC","PMPC","SLIC","WBIC","WBPC","WGIC","WGPC","WLIC");
		
		
foreach($this->targetList as $key => $v){
?>  
  <tr>
    <td>
      <input  type="text" name="shop_code[<?php echo $key?>]" id="shop_code<?php echo $key?>" value="<?php echo trim($v[0])?>" readonly="readonly" /></td>
    <td>
    <?php
	if($key==0){
	 ?>
      <input  type="text" name="date_begin" id="date_begin" value = "<?php echo $this->dateStart;?>" readonly="readonly"/>
    <?php } ?>  
      </td>
    <td>
    <?php
	if($key==0){
	 ?>
    <input  type="text" name="date_end" id="date_end" value = "<?php echo $this->dateEnd;?>" readonly="readonly"/>
    
     <?php } ?>  
    </td>
    <td><input  type="text" name="target[<?php echo $key?>]" id="target[<?php echo $key?>]" class = "target" value = "<?php echo $v[2];?>"onchange = "ischeck()"/>
      </td>
     <td>
      <input  type="text" name="target2[<?php echo $key?>]" id="target2[<?php echo $key?>]" class ="target2" value = "<?php echo $v[3];?>"/>
      </td>
      <td>
      <input  type="text" name="target3[<?php echo $key?>]" id="target3[<?php echo $key?>]" class = "target3" value = "<?php echo $v[4];?>"/>
      </td>
      <td>
      <input  type="text" name="htarget[<?php echo $key?>]" id="htarget[<?php echo $key?>]" class = "htarget" value = "<?php echo $v[5];?>"/>
      </td>
     <td>
      <input  type="text" name="htarget2[<?php echo $key?>]" id="htarget2[<?php echo $key?>]" class ="htarget2" value = "<?php echo $v[6];?>"/>
      </td>
      <td>
      <input  type="text" name="htarget3[<?php echo $key?>]" id="htarget3[<?php echo $key?>]" class = "htarget3" value = "<?php echo $v[7];?>"/>
      </td>
  </tr>
<?php }?>  
<tr>
<td colspan="6" align="center" valign="middle">Hint:Offi*****   Password: 
  <label for="password"></label>
  <input type="password" name="password" id="password" />
   <input type="submit" name="button" id="button" value="Submit" /></td>
   <td colspan = "3">&nbsp;</td>
</tr>

</table>
<?php }?>
<?php if ($this->rTarget){?>
<table width = "800" cellspacing="1" cellpadding="3">

  <tr>
    <th scope="col">Shop</th>
    <th scope="col">Date Begin</th>
    <th scope="col">Date End</th>
    <th scope="col">Target</th>
    <th scope="col">Target2</th>
    <th scope="col">Target3</th>
    <th scope="col">HTarget</th>
    <th scope="col">HTarget2</th>
    <th scope="col">HTarget3</th>
  </tr>
<?php	
	
foreach($this->rTarget as $key => $v){
?>  
  <tr>
    <td><?php echo $key?></td>
    <td><?php echo $this->dateStart?></td>
    <td><?php echo $this->dateEnd?></td>
    <td><?php echo $v['target']?></td>
    <td><?php echo $v['target2']?></td>
    <td><?php echo $v['target3']?></td>
    <td><?php echo $v['htarget']?></td>
    <td><?php echo $v['htarget2']?></td>
    <td><?php echo $v['htarget3']?></td>
  </tr>
  
<?php }?>
  <tr>
  	<td colspan = "9"><input type="submit" name="sendMail" value="Send Email" /></td>
  </tr>
  </table>
<?php }?>
</form>
<br/>
<div id = "teamWizard" <?php if(!$this->nextCheck){?>style = "visibility:hidden;<?php }?>">
<input type = "submit" id = "next" name = "next" value = "SA Bonus Old Version" style = "margin-left:600px;" onclick= "transfer2('<?php echo $this->dateStart;?>','<?php echo $this->dateEnd;?>')"></input>
<input type = "submit" id = "next" name = "next" value = "Vic Bonus New Version" style = "margin-left:40px;" onclick= "transfer('<?php echo $this->dateStart;?>','<?php echo $this->dateEnd;?>')"></input>
</div>
<p>&nbsp;</p>

</body>
</html>